package com.hsd.znsh.repository;

import com.hsd.znsh.entity.Pick;
import com.hsd.znsh.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/*
 * @auther: wangjiacai
 *
 * @create: 2018-04-23 11:54:50
 */
public interface PickRepository extends JpaRepository<Pick,Integer> {

    List<Pick> findByBatchIdOrderByPickSnDesc(Integer batchId);

    @Query("select max(pickSn) from Pick where batchId=?1")
    String findMaxPickSnByBatchId(Integer batchId);
}
